package cn.e4j.modular.crm.controller;

import cn.e4j.core.base.controller.BaseController;
import cn.e4j.core.dto.impl.Dto;
import cn.e4j.core.dto.requestDtoResolver.DtoParam;
import cn.e4j.core.dto.requestDtoResolver.DtoWapper;
import cn.e4j.core.reqres.response.ErrorResponseData;
import cn.e4j.core.reqres.response.PageReData;
import cn.e4j.core.reqres.response.ResponseData;
import cn.e4j.core.shiro.ShiroKit;
import cn.e4j.core.shiro.ShiroUser;
import cn.e4j.core.util.DateUtils;
import cn.e4j.modular.crm.entity.MmrdT;
import cn.e4j.modular.crm.service.impl.Gwai741ServiceImpl;
import cn.e4j.modular.crm.service.impl.MmrdTServiceImpl;
import cn.e4j.modular.crm.service.impl.MmrfTServiceImpl;
import cn.e4j.modular.crm.service.impl.MmrnTServiceImpl;
import cn.e4j.modular.utils.CrmExceptionEnum;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 设备维修保养记录查询
 * @author yuanrz
 * @since 2019-12-23
 */
@Controller
@RequestMapping("/crm/gwai741")
public class Gwai741Controller extends BaseController {

    @Autowired
    Gwai741ServiceImpl gwai741Service;

    /**
     * 跳转设备维修保养记录查询页面
     */
    @RequiresPermissions("crm:gwai741:init")
    @RequestMapping(value = {"", "init"})
    public String index() {
        return "/pc/crm/gwai741.html";
    }

    /**
     * 查询设备维修保养记录信息列表
     */
    @RequestMapping("/getListData")
    @RequiresPermissions("crm:gwai741:init")
    @ResponseBody
    public ResponseData getListData(@DtoParam DtoWapper dtoWapper) {
        Page<Object> page = dtoWapper.getPage();
        Dto inDto = dtoWapper.getDto();
        List<Dto> result = gwai741Service.getListData(page, inDto);
        return new PageReData(page, result);
    }
}
